import request from '@/utils/request'
// 值班长代办
export function agency(data) {
  return request({
    url: '/matters/duty/action/items',
    method: 'post',
    data: data,
  })
}
// 值班长个人台账
export function individual(data) {
  return request({
    url: '/matters/duty/individual/account',
    method: 'post',
    data: data,
  })
}
// 公告分页查询所有
export function Notice(current, limit, status, title) {
  return request({
    url: '/notice/noticeList',
    method: 'get',
    params: {
      current: current,
      limit: limit,
      status: status,
      title: title,
    },
  })
}

// 新增公告
export function addNotice(data) {
  return request({
    url: '/notice/saveNotice',
    method: 'post',
    data: data,
  })
}
// 值班长代办数量
export function quantity() {
  return request({
    url: '/matters/seater/action/items/count',
    method: 'post',
  })
}
// 按照id查看公告详情
export function getNoticeMessage(id) {
  return request({
    url: '/notice/info',
    method: 'get',
    params: {
      id: id,
    },
  })
}
// 删除公告
export function del(id) {
  return request({
    url: '/notice/remove',
    method: 'get',
    params: {
      id: id,
    },
  })
}
// 修改公告
export function updateNotice(data) {
  return request({
    url: '/notice/updateNotice',
    method: 'post',
    data: data,
  })
}
// 修改公告状态
export function updateStatus(id, status) {
  return request({
    url: '/notice/updateStatus',
    method: 'get',
    params: {
      id: id,
      status: status,
    },
  })
}
// 查询所有事项问题分类
export function classification() {
  return request({
    url: '/matters/selectmattertype',
    method: 'get',
  })
}
// 获取职能部门角色人员
export function role(data) {
  return request({
    url: '/role/department/get',
    method: 'post',
    data: data,
  })
}
// 值班长批量确认
export function batch(data) {
  return request({
    url: '/matters/shift-leder/batch/confirm',
    method: 'post',
    data: data,
  })
}
// 分页查询所有（值班长和网格长专用）
export function query(current, limit) {
  return request({
    url: '/leave/duty',
    method: 'get',
    params: {
      current: current,
      limit: limit,
    },
  })
}
// 请假申请审批通过
export function adopt(id) {
  return request({
    url: '/leave/updatePassed',
    method: 'get',
    params: {
      id: id,
    },
  })
}
// 请假申请审批不通过
export function Fail(data) {
  return request({
    url: '/leave/updateFailed',
    method: 'post',
    data: data,
  })
}
// 获取所有权限信息
export function getjurisdiction() {
  return request({
    url: '/permission/list/all',
    method: 'post',
  })
}
// （责任部门）提交
export function matters(data) {
  return request({
    url: '/matters/responsible/submit',
    method: 'post',
    data: data,
  })
}
// 值班长提交
export function submitmessage(data) {
  return request({
    url: '/matters/duty/submit',
    method: 'post',
    data: data,
  })
}
// 超级管理员修改用户信息
export function superget(data) {
  return request({
    url: '/user/super/update',
    method: 'post',
    data: data,
  })
}
// 销假审批通过
export function vacationPassed(id) {
  return request({
    url: '/leave/vacationPassed',
    method: 'get',
    params: {
      id: id,
    },
  })
}
// 销假审不批通过
export function vacationFailed(data) {
  return request({
    url: '/leave/vacationFailed',
    method: 'post',
    data: data,
  })
}
// 统计分析列表数据
export function statistics(data) {
  return request({
    url: '/statisticalData/statistics',
    method: 'post',
    data: data,
  })
}
// 火星坐标系(GCJ02)转百度坐标系(bd09II)
export function convert(lat, lng) {
  return request({
    url: '/plat/taranfom/mars/to/bd',
    method: 'get',
    params: {
      lat: lat,
      lng: lng,
    },
  })
}
// 根据roleID查询出网格的责任部门id，根据责任部门id查询出责任网格的所有id,返回格内用户信息
export function dutyGridAnalysis(data) {
  return request({
    url: '/duty/grid/analysis',
    method: 'post',
    data: data,
  })
}
// 通过id主键获取人员详细信息
export function idGetUser(data) {
  return request({
    url: '/user/get/by-id',
    method: 'get',
    params: data,
  })
}
// 通过id主键获取人员详细信息
export function findAll() {
  return request({
    url: '/specialPlan/findAll',
    method: 'get',
  })
}

export default {
  individual,
  agency,
  addNotice,
  Notice,
  getNoticeMessage,
  del,
  classification,
  role,
  batch,
  query,
  adopt,
  Fail,
  getjurisdiction,
  matters,
  superget,
  updateNotice,
  updateStatus,
  vacationPassed,
  vacationFailed,
  statistics,
  convert,
  submitmessage,
  dutyGridAnalysis,
  idGetUser,
  findAll,
}
